<template>
  <div class="body-container layout-padding">
    <div class="clearfix">
      <el-button size="default" type="primary"  @click="btnExport">
        <el-icon><ele-CirclePlus /></el-icon>导入
      </el-button>
    </div>

    <el-dialog title="文件导入" v-model="state.exportVisible" :close-on-click-modal="false" width="888px">
      <ImportHome v-if="state.exportVisible" v-model="state.exportVisible" :entityTypeId="state.importExcelType"></ImportHome>
    </el-dialog>
  </div>
</template>

<script setup name="studentIndex">
import request from '/@/utils/request';
import { ElMessage } from 'element-plus';
import mittBus from '/@/utils/mitt';
import {reactive, ref, onMounted, onUnmounted, defineAsyncComponent} from "vue";
import ImportExcelType from "/@/utils/ImportExcelType";

const ImportHome = defineAsyncComponent(() => import('/@/components/ImportHome.vue'));
const state = reactive({
  exportVisible : false,
  importExcelType : ImportExcelType.shengChanTest
})
const btnExport = ()=>{
  state.exportVisible= true
}

onMounted(()=>{
  mittBus.on("exportComplete", ()=>{
    ElMessage.success("上传成功了")
  })
})
onUnmounted(()=>{
  mittBus.off("exportComplete", ()=>{})
})
</script>

<style scoped>

</style>
